<?php
/**
 * Este Widget muestra la barra de fortaleza de contraseña
 * 
 * @package CWidget
 * @author j.m.j.s. (19/08/2009)
 * @version 1.0
 */
class PasswordStrength extends CWidget
{	
	public function run()
	{
		$this->registerClientScripts();
		$this->render('passwordStrength');
	}

  /**
   * Registers the clientside widget files (css & js)
   */
  private function registerClientScripts() 
  {
    // Get the resources path
    $resources = dirname(__FILE__).DIRECTORY_SEPARATOR.'resources';

    // publish the files
    $baseUrl = Yii::app()->assetManager->publish($resources);

    Yii::app()->clientScript->registerScriptFile($baseUrl.'/pwd_meter.js');
    Yii::app()->clientScript->registerCssFile($baseUrl.'/estyle.css');
  }
}